Skip to content

Conversation

@Zalathar
Copy link
Member

@Zalathar Zalathar commented Nov 3, 2025

This PR adds a suite of snapshot tests for how bootstrap translates command-line “paths” (which are not necessarily actual paths) into a set of top-level steps to execute.

Unlike the existing suite of snapshot tests (for transitive step logging), I decided to use .snap files over inline snapshots, because I find that inline snapshots quickly make test files impossible to navigate. Instead, I set up a macro that makes it relatively easy to add or modify test cases.

Using .snap files also means that the tests can be blessed by setting INSTA_UPDATE=always, without necessarily needing the cargo insta tool installed, though the tool can still be used instead if desired.

These snapshot tests capture current behavior, to prevent unintended changes or regressions. If the current behavior is wrong or undersirable, then any fix will necessarily have to re-bless the affected tests!

r? Kobzol

@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Nov 3, 2025
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@Zalathar
Copy link
Member Author

Zalathar commented Nov 3, 2025

It’s worrying that CI sees different snapshots.

I wonder if the “real” host/target is bleeding through somehow?

@Zalathar
Copy link
Member Author

Zalathar commented Nov 3, 2025

Oh gross, x test includes bootstrap only when a CI environment is detected.

Still not sure what's going on with the rustdoc JS tests; perhaps something is detecting that I don't have the requisite paths set on my machine?

@Zalathar
Copy link
Member Author

Zalathar commented Nov 3, 2025

Yeah, looks like those steps auto-skip themselves when build.nodejs is not set and fails to resolve to an ambient tool in the current PATH.

@rust-log-analyzer

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants